<style type="text/css">
.footer {
  position: absolute;
  bottom: 5vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.button-container {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.btn-operate {
  display: flex;
  justify-content: space-between;
  z-index: 9999;
}

.btn-operate-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.btn-operate-item text {
  font-size: 14px;
  color: #f0e9e9;
  padding: 5px;
  letter-spacing: 0;
  font-weight: 400;
}

.call-switch text {
  padding: 5px;
  color: #f0e9e9;
  font-size: 14px;
}

.call-operate {
  width: 8vh;
  height: 8vh;
  border-radius: 8vh;
  margin: 0 15vw;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}
.call-switch .call-operate {
  width: 4vh;
  height: 3vh;
}

.call-operate image {
  width: 100%;
  height: 100%;
  background: none;
}

.tips {
  font-size: 20px;
  color: #ffffff;
  letter-spacing: 0;
  margin: 0 auto;
  /* text-shadow: 0 1px 2px rgba(0,0,0,0.40); */
  font-weight: 600;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tips-subtitle {
  font-family: PingFangSC-Regular;
  font-size: 14px;
  color: #ffffff;
  letter-spacing: 0;
  text-align: right;
  /* text-shadow: 0 1px 2px rgba(0,0,0,0.30); */
  font-weight: 400;
}

.invite-call {
  position: absolute;
  top: 0;
  z-index: 100;
  width: 100vw;
  height: 100vh;
  background-color: black;
}

.transition-animation {
  transform: translateY(-100%);
  animation: slideInDown 0.5s ease forwards;
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.invite-call .local-video {
  width: 100vw;
  height: 100vh;
}
.invite-call .invite-calling {
  position: absolute;
  top: 0;
  z-index: 101;
  width: 100vw;
  height: 100vh;
}
.invite-calling-header {
  margin-top: 107px;
  display: flex;
  justify-content: flex-end;
  padding: 0 16px;
}
.btn-container {
  display: flex;
  align-items: center;
  position: relative;
}
.invite-calling-header-left {
  position: absolute;
  right: 0;
}
.invite-calling-header-left image {
  width: 32px;
  height: 32px;
}
.invite-calling-header-right {
  display: flex;
  align-items: center;
}
.invite-calling-header-message {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}
.invite-calling-header-right image {
  width: 100px;
  height: 100px;
  border-radius: 12px;
}
.invite-calling .footer {
  position: absolute;
  bottom: 5vh;
  width: 100%;
}
.invite-calling .btn-operate {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none;
}

.trtc-calling {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  z-index: 99;
}

.audio-call {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  z-index: 100;
  background: #ffffff;
}
.audio-call > .btn-operate {
  display: flex;
  justify-content: center;
}

.audio-call > image {
  width: 40vw;
  height: 40vw;
  display: block;
  margin: 20vw 30vw;
  margin-top: 40vw;
}

.invite-calling-single > image {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  display: block;
  margin: 140px auto 15px;
  /* margin: 20vw 30vw; */
}

.invite-calling-single .tips {
  width: 100%;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 20px;
  color: #333333;
  letter-spacing: 0;
  font-weight: 500;
}
.invite-calling-single .tips-subtitle {
  height: 20px;
  font-family: PingFangSC-Regular;
  font-size: 14px;
  color: #97989c;
  letter-spacing: 0;
  font-weight: 400;
  text-align: center;
}

.invite-calling-list {
  justify-content: flex-start;
}

.invite-calling-item {
  position: relative;
  margin: 0 12px;
}
.invite-calling-item image {
  width: 100px;
  height: 100px;
  border-radius: 12px;
}
.invite-calling-item-message {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  width: 100px;
  height: 100px;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.avatar {
  background: #dddddd;
}

.player {
  position: absolute;
  right: 16px;
  top: 107px;
  width: 100px;
  height: 178px;
  padding: 16px;
  z-index: 999;
}

.pusher-video {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.stream-box {
  position: relative;
  float: left;
  width: 50vw;
  height: 260px;
  /* background-color: #f75c45; */
  z-index: 3;
}

.handle-btns {
  position: absolute;
  bottom: 44px;
  width: 100vw;
  z-index: 3;
  display: flex;
  flex-direction: column;
}

.handle-btns .btn-list {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}

.button-container {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.btn-normal {
  width: 8vh;
  height: 8vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  /* background: white; */
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.btn-image {
  width: 100%;
  height: 100%;
  background: none;
}

.btn-hangup {
  width: 8vh;
  height: 8vh;
  /*background: #f75c45;*/
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.btn-hangup > .btn-image {
  width: 100%;
  height: 100%;
  background: none;
}

.TRTCCalling-call-audio {
  width: 100%;
  height: 100%;
}

.btn-footer {
  position: relative;
}

.btn-footer .multi-camera {
  width: 32px;
  height: 32px;
}

.btn-footer .camera {
  width: 64px;
  height: 64px;
  position: fixed;
  left: 16px;
  top: 107px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
}

.btn-footer .camera .camera-image {
  width: 32px;
  height: 32px;
}

.TUICalling-connected-layout {
  width: 100%;
  height: 100%;
}

.audio {
  padding-top: 15vh;
  background: #ffffff;
}

.pusher-audio {
  width: 0;
  height: 0;
}

.player-audio {
  width: 0;
  height: 0;
}

.live {
  width: 100%;
  height: 100%;
}

.other-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 18px;
  letter-spacing: 0;
  font-weight: 400;
  padding: 16px;
}

.white {
  color: #f0e9e9;
  padding: 5px;
  font-size: 14px;
}

.black {
  color: #000000;
  padding: 5px;
}

.TRTCCalling-call-audio-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.mutil-img {
  justify-content: flex-start !important;
}

.TRTCCalling-call-audio-img {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.TRTCCalling-call-audio-img > image {
  width: 25vw;
  height: 25vw;
  margin: 0 4vw;
  border-radius: 4vw;
  position: relative;
}

.TRTCCalling-call-audio-img text {
  font-size: 20px;
  color: #333333;
  letter-spacing: 0;
  font-weight: 500;
}

.btn-list-item {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.btn-image-small {
  transform: scale(0.7);
}

.avatar {
  background: #dddddd;
}

.btn-container {
  display: flex;
  align-items: center;
  position: relative;
}

.invite-calling-connected {
  position: absolute;
  right: -88px;
}

.invite-calling-connected image {
  width: 32px;
  height: 32px;
}

.call-switch .call-operate {
  width: 4vh;
  height: 3vh;
}

.call-operate image {
  width: 100%;
  height: 100%;
  background: none;
}

.call-switch text {
  padding: 0;
  font-size: 14px;
}

.btn-operate-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-operate-item text {
  padding: 8px 0;
  font-size: 18px;
  color: #ffffff;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 14px;
}

</style>
<!-- 音频通话 -->
<div class="{if $callMediaType === 1}'audio-call'{else}'invite-call'{/if} transition-animation">
  <!-- 本地流 -->
  <div class="{if $callMediaType === 1}'pusher-audio'{else}{if $bigScreenUserId || $callStatus === 'calling'}'pusher-video'{else}'player'{/if}{/if}" data-screen="pusher" catch:tap="toggleViewSize">
    <live-pusher class="{{callMediaType === 1?'pusher-audio':'live'}}" url="{{pusher.url}}" mode="{{pusher.mode}}" autopush="{{true}}" enable-camera="{{pusher.enableCamera}}" enable-mic="{{true}}" muted="{{!pusher.enableMic}}" enable-agc="{{true}}" enable-ans="{{true}}" enable-ear-monitor="{{pusher.enableEarMonitor}}" auto-focus="{{pusher.enableAutoFocus}}" zoom="{{pusher.enableZoom}}" min-bitrate="{{pusher.minBitrate}}" max-bitrate="{{pusher.maxBitrate}}" video-width="{{pusher.videoWidth}}" video-height="{{pusher.videoHeight}}" beauty="{{pusher.beautyLevel}}" whiteness="{{pusher.whitenessLevel}}" orientation="{{pusher.videoOrientation}}" aspect="{{pusher.videoAspect}}" device-position="{{pusher.frontCamera}}" remote-mirror="{{pusher.enableRemoteMirror}}" local-mirror="{{pusher.localMirror}}" background-mute="{{pusher.enableBackgroundMute}}" audio-quality="{{pusher.audioQuality}}" audio-volume-type="{{pusher.audioVolumeType}}" audio-reverb-type="{{pusher.audioReverbType}}" waiting-image="{{pusher.waitingImage}}" beauty-style="{{pusher.beautyStyle}}" filter="{{pusher.filter}}" bindstatechange="pusherStateChangeHandler" bindnetstatus="pusherNetStatus" binderror="pusherErrorHandler" bindaudiovolumenotify="pusherAudioVolumeNotify" />
  </div>
  <!-- 远端流 -->
  <div class="view-container player-container" catch:tap="toggleViewSize">
    <div class="{if $callMediaType === 1}'player-audio'{else}{if !$bigScreenUserId}'pusher-video'{else}'player'{/if}{/if}" data-screen="player">
      <live-player class="live" ng-if="item.hasAudio || item.hasVideo" id="{{item.id}}" data-userid="{{item.userID}}" data-streamid="{{item.streamID}}" data-streamtype="{{item.streamType}}" src="{{item.src}}" mode="RTC" autoplay="{{item.autoplay}}" mute-audio="{{item.muteAudio}}" mute-video="{{item.muteVideo}}" orientation="{{item.orientation}}" object-fit="{{item.objectFit}}" background-mute="{{item.enableBackgroundMute}}" min-cache="{{item.minCache}}" max-cache="{{item.maxCache}}" sound-mode="{{isEarPhone?'ear':'speaker'}}" enable-recv-message="{{item.enableRecvMessage}}" auto-pause-if-navigate="{{item.autoPauseIfNavigate}}" auto-pause-if-open-native="{{item.autoPauseIfOpenNative}}" bindstatechange="playerStateChange" bindfullscreenchange="playerFullscreenChange" bindnetstatus="playNetStatus" bindaudiovolumenotify="playerAudioVolumeNotify" />
    </div>
  </div>
  <!-- 语言通话邀请信息 -->
  {if $callMediaType === 1}
  <div class="invite-calling-single">
    <img class="avatar" src="{php echo toimage($return['member']['avatar'])}" id="{$tomember['id']}" binderror="handleErrorImage" />
    <div class="tips">{$tomember['nickname']}</div>
	 {if $callRole === 'caller' && $callStatus === 'calling'}
    <div class="tips-subtitle">等待对方接受</div>
	 {/if}
  </div>
   {/if}
  <!-- 视频通话邀请信息 -->
  {if $callStatus === 'calling' && $callMediaType === 2}
  <div class="invite-calling">
    <div class="invite-calling-header">
      <div class="invite-calling-header-right">
        <div class="invite-calling-header-message">
          <label class="tips">
           {$tomember['nickname']}
          </label>
		  {if $callRole !== 'caller'}
          <text class="tips-subtitle">邀请你视频通话</text>
		  {/if}
		  {if $callRole === 'caller'}
          <text class="tips-subtitle" ng-if="">等待对方接受</text>
		  {/if}
        </div>
        <img class="avatar" src="{php echo toimage($return['tomember']['avatar'])}" id="{{remoteUserInfoList[0].userId}}" binderror="handleErrorImage" />
      </div>
    </div>
  </div>
   {/if}
  <!-- 语音通话呼叫状态按钮 -->
  {if $callStatus === 'calling' && $callMediaType === 1}
  <div class="footer">
  {if $callRole !== 'caller'}
    <div class="btn-operate">
      <div class="button-container">
        <div class="call-operate" style="background-color: red" catch:tap="reject">
         <img src="../addons/jy_videocall/resource/call/hangup.png"/>
        </div>
        <div style="margin-top:10px">挂断</div>
      </div>
      <div class="button-container">
        <div class="call-operate" catch:tap="accept">
         <img src="../addons/jy_videocall/resource/call/dialing.png" />
        </div>
        <div style="margin-top:10px">接听</div>
      </div>
    </div>
	{/if}
	{if $callRole === 'caller'}
    <div class="btn-operate">
      <div class="button-container">
        <div class="call-operate" style="background-color: red" catch:tap="hangup">
         <img src="../addons/jy_videocall/resource/call/hangup.png"/>
        </div>
        <div style="margin-top:10px">挂断</div>
      </div>
    </div>
	{/if}
  </div>
   {/if}
  {if $callStatus === 'calling' && $callMediaType === 2}
  <!-- 视频通话呼叫状态按钮 -->
  <div class="invite-calling">
    <div class="footer">
      <div class="btn-operate">
        <div class="btn-operate-item call-switch" catch:tap="switchCallMediaType">
          <div class="call-operate">
           <img src="../addons/jy_videocall/resource/call/trans.png"/>
          </div>
          <text>切到语音通话</text>
        </div>
      </div>
      <div class="btn-operate">
        <div class="btn-operate-item">
          <div class="btn-container">
            <div class="call-operate" catch:tap="hangup">
             <img src="../addons/jy_videocall/resource/call/hangup.png"/>
            </div>
            <div class="invite-calling-header-left">
             <img src="../addons/jy_videocall/resource/call/switch_camera.png" data-device="{{pusher.frontCamera}}" catch:tap="switchCamera" />
            </div>
          </div>
          <text>挂断</text>
        </div>
      </div>
      <div class="btn-operate" ng-if="callRole !== 'caller'">
        <div class="btn-operate-item">
          <div class="call-operate" style="background-color: red" catch:tap="reject">
           <img src="../addons/jy_videocall/resource/call/hangup.png"/>
          </div>
          <text>挂断</text>
        </div>
        <div class="btn-operate-item">
          <div class="call-operate" catch:tap="accept">
           <img src="../addons/jy_videocall/resource/call/dialing.png"/>
          </div>
          <text>接听</text>
        </div>
      </div>
    </div>
  </div>
   {/if}
   {if $callStatus === 'connected' && $callMediaType === 1}
  <!-- 语音通话接通状态按钮 -->
  <div class="handle-btns">
    <div class="other-view black">
      <text>{{callDuration}}</text>
    </div>
    <div class="btn-list">
      <div class="button-container">
        <div class="btn-normal" bindtap="microPhoneHandler">
         <img class="btn-image" src="{{localUserInfo.isAudioAvailable?'../addons/jy_videocall/resource/call/audio-true.png':'../addons/jy_videocall/resource/call/audio-false.png'}}"></image>
        </div>
        <div>麦克风</div>
      </div>
      <div class="button-container">
        <div class="btn-hangup" bindtap="hangup">
         <img class="btn-image" src="../addons/jy_videocall/resource/call/hangup.png"></image>
        </div>
        <div>挂断</div>
      </div>
      <div class="button-container">
        <div class="btn-normal" bindtap="toggleSoundMode">
         <img class="btn-image" src="{{isEarPhone?'../addons/jy_videocall/resource/call/speaker-false.png':'../addons/jy_videocall/resource/call/speaker-true.png'}}"></image>
        </div>
        <text>扬声器</text>
      </div>
    </div>
  </div>
   {/if}
  <!-- 视频通话接听状态按钮 -->
  {if $callStatus === 'connected' && $callMediaType === 2}
  <div class="invite-calling">
    <div class="handle-btns">
      <div class="other-view white">
        <text>{{callDuration}}</text>
      </div>
      <div class="btn-operate-item call-switch" catch:tap="switchCallMediaType">
        <div class="call-operate">
         <img src="../addons/jy_videocall/resource/call/hangup.png"/>
        </div>
        <text>切到语音通话</text>
      </div>
      <div class="btn-list">
        <div class="button-container" bindtap="microPhoneHandler">
          <div class="btn-normal">
           <img class="btn-image" src="{{localUserInfo.isAudioAvailable?'../addons/jy_videocall/resource/call/audio-true.png':'../addons/jy_videocall/resource/call/audio-false.png'}}"></image>
          </div>
          <div class="white">麦克风</div>
        </div>
        <div class="button-container" bindtap="toggleSoundMode">
          <div class="btn-normal">
           <img class="btn-image" src="{{isEarPhone?'../addons/jy_videocall/resource/call/speaker-false.png':'../addons/jy_videocall/resource/call/speaker-true.png'}}"></image>
          </div>
          <text class="white">扬声器</text>
        </div>
        <div class="button-container" bindtap="cameraHandler">
          <div class="btn-normal">
           <img class="btn-image" src="{{localUserInfo.isVideoAvailable?'../addons/jy_videocall/resource/call/camera-true.png':'../addons/jy_videocall/resource/call/camera-false.png'}}"></image>
          </div>
          <text class="white">摄像头</text>
        </div>
      </div>
      <div class="btn-list">
        <div class="btn-list-item other-view">
          <div class="btn-container">
            <div class="btn-hangup" bindtap="hangup">
             <img class="btn-image" src="../addons/jy_videocall/resource/call/hangup.png"></image>
            </div>
			{if $localUserInfo['isVideoAvailable']}
            <div class="invite-calling-connected">
             <img src="../addons/jy_videocall/resource/call/switch_camera.png" data-device="{{pusher.frontCamera}}" catch:tap="switchCamera" />
            </div>
			{/if}
          </div>
          <text class="white">挂断</text>
        </div>
      </div>
    </div>
  </div>
   {/if}
</div>
<script type="text/javascript">
var callMediaType=1;
var callStatus = 'calling'
</script>